home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
422mods.zip
/
JAFO04.422
< prev
next >
Wrap
Text File
|
1993-02-14
|
12KB
|
440 lines
JAFO04D.MOD
JAFO #1 @18868
Fri Feb 12 1993 21:15:48
┌────────────────────────────────────────────────────────────────────────────┐
│ Mod Name : JAFO04D.MOD Mod Author: JAFO 1@1 TerraNET │
│ Difficulty : █████▒▒▒▒▒ 1@8857 IceNET │
│ WWIV Version : 4.22 1@8861 WWIVnet │
│ Mod Date : 02/02/93 1@18868 WWIVLink │
│ Files Affected: BBS.C, BBSUTL.C, COM.C, SHRINK.C, UTILITY.C, VARS.H │
│ Description : Enhanced Main Menu & Transfer Prompts │
└────────────────────────────────────────────────────────────────────────────┘
══[ Description ]═════════════════════════════════════════════════════════════
This mod will change the way your main menu and transfer prompts work.
Normally, if you type '>', a few line spaces occur and the new prompt
appears below. Here is an example:
T - 50:33:21
[1] [SysOp Announcements] :>
T - 50:33:19
[2] [General] :
As you can see, if you wanted to go to sub #30, it could take up 5 screens
to get there! This mod will keep the prompt on the SAME line while you
advance or retreat subs, as well as directories, IF the user has ANSI
enabled. If you have modified your prompts to include random quotes or
something, and have more than 2 lines, I'd suggest not using this mod,
because additional code will be required, and it will be very slow at 2400
baud.
Revision B Note: If you are using the original version of this mod,
JAFO04, then I suggest you completely rip it out of
your source and install this mod. This one is far
easier to install too!
Revision C Note: There was a very minor bug in 2.0. I forgot to add
a single line in BBS.C so that while at WFC everything
acts normally. If you installed V2.0, you probably
noticed everything was kinda screwy at WFC.
Revision D Note: This version of the mod now keeps the prompt on the same
line when you press a valid sub/dir number. This was a
feature of the original mod, but was taken out of
subsequent versions (not by design). It has since been
requested by many people, so it is in now.
══[ Legend ]══════════════════════════════════════════════════════════════════
= Existing line - Do not change
$ Existing line - Line has wrapped from previous line
+ Add this line
- Remove this line
% Change this line
══[ Step 1 ]══════════════════════════════════════════════════════════════════
Please back up your source code. Even the best programmers make mistakes.
══[ Step 2 ]══════════════════════════════════════════════════════════════════
In VARS.H, change the line shown. You are adding the "newline" variable.
= userfile, usernum, useron, use_workspace, using_modem,
% wfc, x_only, newline;
=
= __EXTRN__ unsigned short com_speed, *csn_index, crc, *gat, modem_flag,
= modem_mode, modem_speed, net_sysnum;
══[ Step 3 ]══════════════════════════════════════════════════════════════════
In BBS.C, add the the following line near the top.
= #define _DEFINE_GLOBALS_
= #include "vars.h"
= #include "subxtr.h"
=
=
= #include <math.h>
+ #include <ctype.h>
=
=
= unsigned _stklen=15360;
══[ Step 4 ]══════════════════════════════════════════════════════════════════
Put the following function right before "int checkpw".
void prompt(char *s)
{
if ((okansi()) && (!newline))
outstr("\r\x1b[1A");
else
nl();
tleft(1);
npr("T - %s\r\n",ctim(nsl()));
prt(2,s);
if ((okansi()) && (!newline))
outstr("\x1b[K");
newline=0;
}
══[ Step 5 ]══════════════════════════════════════════════════════════════════
In "void mainmenu", make the changes shown.
= void mainmenu(void)
= {
= char *s, s1[81],s2[81],ch;
% int i,i1;
= long l;
= double d;
=
= tleft(1);
= if ((sysstatus_expert & thisuser.sysstatus)==0)
= printmenu(0);
=
- nl();
- nl();
- tleft(1);
- npr("T - %s\r\n",ctim(nsl()));
= s1[0]=0;
= if (usub[cursub].subnum==-1) {
= cursub=0;
= if (usub[cursub].subnum==-1) {
= strcpy(s1,get_string(16));
= }
= }
= if (s1[0]==0)
= sprintf(s1,"[%s] [%s] :",usub[cursub].keys,
$ subboards[usub[cursub].subnum].name);
+ prompt(s1);
- prt(2,s1);
= helpl=1;
= s=mmkey(0);
= helpl=0;
% if (s[0]) {
+ i1=0;
% for (i=0; (i<num_subs) && (usub[i].subnum!=-1); i++) {
% if (strcmp(usub[i].keys,s)==0) {
= cursub=i;
+ i1=1;
+ }
+ }
+ if ((!i1) && (okansi()) && (isdigit(s[0])) &&
+ ((sysstatus_expert & thisuser.sysstatus)!=0)) {
+ nl();
+ newline=1;
+ }
+ } else
+ newline=1;
= if (strlen(s)>2) {
= sprintf(s1,"//%s",s);
= sysopchar(s1);
══[ Step 6 ]══════════════════════════════════════════════════════════════════
In "void dlmainmenu", make the changes shown.
= void dlmainmenu(void)
= {
= char *s, s1[81],s2[81],ch;
= int i,i1,i2,abort,next;
= messagerec m;
=
= tleft(1);
= if ((sysstatus_expert & thisuser.sysstatus)==0)
= printmenu(3);
=
- nl();
- nl();
- tleft(1);
- npr("T - %s\r\n",ctim(nsl()));
= s1[0]=0;
= if (udir[curdir].subnum==-1) {
= curdir=0;
= if (udir[curdir].subnum==-1) {
= strcpy(s1,get_string(32));
= curdloads=0;
= return;
= }
= }
= if (s1[0]==0)
= sprintf(s1,"(%s)-(%s) :",udir[curdir].keys,
$ directories[udir[curdir].subnum].name);
+ prompt(s1);
- prt(2,s1);
= helpl=2;
= s=mmkey(1);
= helpl=0;
% if (s[0]) {
+ i1=0;
% for (i=0; i<num_dirs; i++) {
% if (strcmp(udir[i].keys,s)==0) {
= curdir=i;
+ i1=1;
+ }
+ }
+ if ((!i1) && (okansi()) && (isdigit(s[0])) &&
+ ((sysstatus_expert & thisuser.sysstatus)!=0)) {
+ nl();
+ newline=1;
+ }
+ } else
+ newline=1;
= if (strlen(s)>2) {
= sprintf(s1,"//%s",s);
= sysopchar(s1);
══[ Step 7 ]══════════════════════════════════════════════════════════════════
In BBSUTL.C, add the following line near the top.
= #include "vars.h"
+ #include <ctype.h>
=
= #pragma hdrstop
══[ Step 8 ]══════════════════════════════════════════════════════════════════
Replace the entire "char *mmkey" function with the one below.
char *mmkey(int dl)
{
static unsigned char cmd1[10],cmd2[81],ch;
int i,i1,i2,p,cp,expert;
if ((sysstatus_expert & thisuser.sysstatus)==0)
expert=0;
else
expert=1;
do {
do {
ch=getkey();
} while ((((ch<' ') && (ch!=13)) || (ch>126)) && (hangup==0));
ch=upcase(ch);
outchr(ch);
if (ch==13)
cmd1[0]=0;
else
cmd1[0]=ch;
cmd1[1]=0;
p=0;
switch(dl) {
case 1:
if (strchr(dtc,ch)!=NULL)
p=2;
else if (strchr(dcd,ch)!=NULL)
p=1;
break;
case 2:
if (strchr(odc,ch)!=NULL)
p=1;
break;
case 0:
if (strchr(tc,ch)!=NULL)
p=2;
else if (strchr(dc,ch)!=NULL)
p=1;
break;
}
if (p) {
cp=1;
do {
do {
ch=getkey();
} while ((((ch<' ') && (ch!=13) && (ch!=8)) || (ch>126))&&(hangup==0));
ch=upcase(ch);
if (ch==13) {
if ((!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
return(cmd1);
} else {
if (ch==8) {
backspace();
cmd1[--cp]=0;
} else {
cmd1[cp++]=ch;
cmd1[cp]=0;
outchr(ch);
if ((ch=='/') && (cmd1[0]=='/')) {
input(cmd2,50);
if (((curdloads!=0) && (curdloads!=1) && (dl!=2)) ||
(!newline)) {
if (isdigit(cmd2[0])) {
if ((curdloads==0) && (dl==0)) {
i1=0;
for (i=0; (i<num_subs) && (usub[i].subnum!=-1); i++)
if (strcmp(usub[i].keys,cmd2)==0)
i1=1;
if (i1)
nl();
}
if ((curdloads==1) && (dl==1)) {
i1=0;
for (i=0; i<num_dirs; i++)
if (strcmp(udir[i].keys,cmd2)==0)
i1=1;
if (i1)
nl();
}
if (dl==2)
nl();
} else
nl();
newline=1;
}
return(cmd2);
} else if (cp==p+1) {
if (((curdloads!=0) && (curdloads!=1) && (dl!=2)) ||
(!newline)) {
if (isdigit(cmd1[0])) {
if ((dl==2) || (!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
} else {
nl();
newline=1;
}
} else {
nl();
newline=1;
}
return(cmd1);
}
}
}
} while (cp);
} else {
if (((curdloads!=0) && (curdloads!=1) && (dl!=2)) ||
(!newline)) {
switch (cmd1[0]) {
case '>':
case '+':
case '<':
case '-':
if ((dl==2) || (!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
break;
default:
if (isdigit(cmd1[0])) {
if ((dl==2) || (!okansi()) || (!expert))
nl();
if (!expert)
newline=1;
} else {
nl();
newline=1;
}
break;
}
} else {
nl();
newline=1;
}
return(cmd1);
}
} while (hangup==0);
cmd1[0]=0;
return(cmd1);
}
══[ Step 9 ]══════════════════════════════════════════════════════════════════
In COM.C, change the following line in "void input1".
= case 13:
= s[curpos] = 0;
= done = echo = 1;
% if ((newline) && (crend))
= nl();
= break;
══[ Step 10 ]═════════════════════════════════════════════════════════════════
In SHRINK.C, add the following line to "int restore_data".
= READ(numbatch);
= READ(numbatchdl);
+ READ(newline);
=
= read(f,batch, numbatch*sizeof(batchrec));
══[ Step 11 ]═════════════════════════════════════════════════════════════════
Add the following line in "void save_state".
= WRITE(numbatch);
= WRITE(numbatchdl);
+ WRITE(newline);
=
= write(f,batch, numbatch*sizeof(batchrec));
══[ Step 12 ]═════════════════════════════════════════════════════════════════
In UTILITY.C, add the following line to "void frequent_init".
= void frequent_init(void)
= /* This should be called after a user is logged off, and will initialize
= * screen-access variables.
= */
= {
= in_fsed=0;
= curlsub=-1;
= ansiptr=0;
+ newline=1;
= curatr=0x07;
= outcom=0;
= incom=0;
══[ Step 13 ]═════════════════════════════════════════════════════════════════
Compile your source. Since we added a variable to VARS.H, a full re-compile
is necessary.
══[ Disclaimer ]══════════════════════════════════════════════════════════════
Don't complain to me if your board gets fried, your hard disk goes nuts, or
something terrible happens. The code in this mod should be harmless, but I
can't guarantee it will work for you. It works on my board.
JAFO 1@1 TerraNET
1@8857 IceNET
1@8861 WWIVnet
1@18868 WWIVLink
7───────────────────── 1Blue Thunder BBS 7─────────────────────
1TerraNET @1 7∙ 1IceNET @8857 7∙ 1WWIVnet @8861 7∙ 1WWIVLink @188680